﻿@model GameSchoolWeb.Models.ExamListModelView
<div id="templatemo_content">
    <!DOCTYPE html>
    <html>
    <head>
        <title>GetExams</title>
    </head>
    <body>
        <div class="templatemo_box">
            <h2>
                Próf</h2>
            <div class="body">
                @if (User.IsInRole("Kennari"))
                {
                    <p>
                        @Html.ActionLink("Búa til nýtt próf", "CreateExam", "Exam", new { id = Model.lvlId }, null)
                    </p>
                }
                <table>
                    <tr>
                        <th>
                            Titill
                        </th>
                        <th>
                            Dagsetning
                        </th>
                        <th>
                            Stig í boði
                        </th>
                        <th>
                        </th>
                    </tr>
                    @foreach (var item in Model.exams)
                    {
                        <tr>
                            <td>
                                @Html.DisplayFor(modelItem => item.strTitle)
                            </td>
                            <td>
                                @Html.DisplayFor(modelItem => item.dDateAdded)
                            </td>
                            <td>
                                @Html.DisplayFor(modelItem => item.nPoints)
                            </td>
                            <td>
                                @if (User.IsInRole("Nemandi"))
                                {
                                    @Html.ActionLink(" Taka próf ", "TurnInExam", new { id = item.id });

                                }
                                @if (User.IsInRole("Kennari"))
                                {                                                                                            
                                    @Html.ActionLink(" Bæta við spurningu ", "AddQuestions", new { id = item.id });


                                }
                            </td>
                            @if (User.IsInRole("Kennari"))
                            {
                                <td>
                                    @Html.ActionLink("Nánar um próf", "Details", new { id = item.id })
                                </td>	
				
                            }
                        </tr>
                    }
                </table>
                <hr />
                <div>
                    @Html.ActionLink("Aftur á forsíðu", "Index", "Home")
                </div>
            </div>
    </body>
    </html>
    <div class="box_bottom">
        <span></span>
    </div>
</div>
